package com.mine.site.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DbUtil {


	private static DbUtil instance= new DbUtil();
	

	private DbUtil() {
		try {
			Class.forName("com.mysql.jdbc.Driver");
			//Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
			
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		System.out.println(" dbUtil  DbUtil() be exec!");
	}
	
	public static DbUtil getInstance(){
		return instance;
	
	}
	
	public  Connection getConn(){
		Connection con = null;
		try {
			con = DriverManager.getConnection(
					//"jdbc:sqlserver://localhost:1433;DatabaseName=mydb", "ss", "123");
					
					"jdbc:mysql://localhost:3306/gouwu", "root", "");
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return con;
		
	}
}
